﻿using FastDFSCore.Protocols;
using FileStorageCenter.Services.Models;

namespace FileStorageCenter.Services.FileStorageProvider;

public interface IFileStorageProvider
{
    ValueTask<byte[]> DownloadFileAsync(string groupName, string fileid, string clusterName = "");

    ValueTask<FastDFSFileInfo> GetFileInfo(string groupName, string fileid, string clusterName = "");

    ValueTask<StorageNode> GetStorageNodeAsync(string groupName, string fileid, string clusterName = "");

    string GetToken(string fileid, string clusterName = "", DateTime? dateTime = null);

    ValueTask<IReadOnlyCollection<GroupInfo>> ListAllGroupInfosAsync(string clusterName);

    ValueTask<GroupInfo> ListOneGroupInfoAsync(string groupName, string clusterName = "");

    ValueTask<IReadOnlyCollection<StorageInfo>> ListStorageInfosAsync(string groupName, string clusterName = "");

    ValueTask<StorageNode> QueryStorageNodeForFileAsync(string groupName, string fileid, string clusterName = "");

    ValueTask<IReadOnlyCollection<StorageNode>> QueryStorageNodesForFileAsync(string groupName, string fileid, string clusterName = "");

    ValueTask<bool> RemoveFileAsync(string groupName, string fileid, string clusterName = "");

    ValueTask<string> UploadFileAsync(UploadModel model);
}